#推导式创建序列
#1.列表推导式
# y = [x for x in range(1,50) if x%5==0]
#
# print(y)
# print()
# z = [x*2 for x in range(1,5)]
# print(z)
#
#
# y=[]
# for x in range(1,50):
#
#      if x%5==0:y.append(x*2)
# print(y)
#
# cells =[(A,B)for A in range(1,10) for B in range(5,15)]
# print(cells)

# #字典推导式
# my_text ="i love you, i love study, i love eat"
# char_count={c:my_text.count(c) for c in my_text}
# print(char_count)

# #集合推导式
# a={x for x in range(1,100) if x%9==0}
# print(a)

#生成器推导式

# gnt=(x for x in range(4))
# print(tuple(gnt))
# print(tuple(gnt))
#
#
# gnt=(x for x in range(4))
# for x in gnt:  #gnt是可迭代的对象
#     print(x,end=",")
# print(tuple(gnt))


#画同心圆
# import turtle
# t=turtle.Pen()
# my_colors=("red","green","yellow","black")
# t.width(5)
# t.speed(11)
# for i in range(10):# 0.1.2.3.4
#     t.penup()
#     t.goto(0,-i*30)   #0.-10.-20.-30.-40.
#     t.pendown()
#     t.color(my_colors[i %len(my_colors)])
#     t.circle(20+i*30) #10.20.30.40.50
#
# turtle.done() #程序执行完，窗口不关闭


#画棋盘
import turtle
t=turtle.Pen()
t.speed(11)
t.color("red")
for i in range(18): #0.1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17
    t.penup()
    t.goto(0,-i*10)
    t.pendown()
    t.goto(170,-i*10)
for j in range(18):
    t.penup()
    t.goto(j*10, 0)
    t.pendown()
    t.goto(j*10, -170)
turtle.done()


